{@ Context::addJsFile("./common/js/jquery.min.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }

<!--@if($act=="dispWikiTreeIndex")-->
    <!--%import("css/jquery.treeview.css")-->
<!--@end-->
<!--%import("css/wiki.css")-->
<!--@if($use_history != 'N' && $act == "dispWikiHistory")-->
    <!--%import("js/diff.js")-->
<!--@end-->
<!--@if($act=="dispWikiTreeIndex")-->
    <!--%import("js/jquery.cookie.js")-->
    <!--%import("js/jquery.treeview.js")-->
<!--@end-->
<!--%import("../../tpl/js/wiki.js")-->
<!--%import("js/mwiki.js")-->

<!--@if(!$module_info->colorset)-->
    {@$module_info->colorset = "white"}
<!--@end-->
<div id="xeDocsCustomHeader">
	<!--@if($module_info->header_text)-->
		{$module_info->header_text}
	<!--@end-->
</div>
<div class="clearAll"></div>
<div class="wiki">
    <div class="wikiInformation">
	<div class="wikiHeader">
		<!--@if($module_info->title)-->
		<div class="wikiTitle">
			<h1 class="wikiTitleText">
			    <a href="{getUrl('','mid',$mid,'listStyle',$listStyle)}">
				{$module_info->title}
				<!--@if($module_info->sub_title)--> : 
				    <br /><em>{$module_info->sub_title}</em>
				<!--@end-->
			    </a>
			</h1>
		</div>
		<!--@end-->

		<!--@if($module_info->comment)-->
		<p class="wikiDescription">{$module_info->comment}</p>
		<!--@end-->
	</div>
	<br />
	<br />
        <div style="clear:left; margin-top: 13px; width:100%; text-align: center;">
	    <div class="cm">
			<a class="bn" href="{getUrl('','act','dispWikiEditPage','entry','','document_srl','','mid',$mid,'vid',$vid)}">{$lang->new_document}</a>
			<a class="bn" href="{getUrl('act','dispWikiContent','entry','','document_srl','')}">{$lang->home_page}</a>
			<a class="bn" href="{getUrl('act','dispWikiTitleIndex','entry','','document_srl','')}">{$lang->cmd_view_document_list}</a>
			<a class="bn" href="{getUrl('act','dispWikiTreeIndex','entry','','document_srl','')}">{$lang->cmd_view_document_tree}</a>
	    </div>
        </div>
    </div>

    <div id="content_Body">
	<!--@if($oDocument && $oDocument->isExists())-->
	<div class="wikiRead">
	    <div class="wikiReadHeader">
		<div class="titleArea">
		    <h3 class="title"><a href="{getUrl('document_srl',$document_srl)}">{$oDocument->getTitle()}</a></h3>
		    <span class="sum">
			<span class="read">{$lang->readed_count} <span class="num">{$oDocument->get('readed_count')}</span></span>
			<span class="vote">{$lang->voted_count} <span class="num">{$oDocument->get('voted_count')}</span></span>
			<span class="date">
			    <!--@if($history)-->
			    <strong>{zdate($history->regdate, 'Y.m.d')}</strong> {zdate($history->regdate, 'H:i:s')}
			    <!--@else-->
			    <strong>{$oDocument->getUpdate('Y.m.d')}</strong> {$oDocument->getUpdate('H:i:s')} 
			    <!--@end-->
			</span>
		    </span>
		</div>

	<!--@if($visit_log)-->
	<div class="visitLog">
		<div class="languages">
			<div class="title_lang_bar">{$lang->title_lang_bar}</div>
			<div class="lang_bar">
				<!--@foreach($lang_supported as $key => $val)-->
					<!--@if (in_array($key, $translatedlangs))-->
						<a href="#" onclick="doChangeLangType('{$key}');return false;" title="{$val}" style="border:1px solid #AA0000;">{strtoupper($key)}</a>
					<!--@else-->
						<!--@if($is_logged)-->
							<a href="#" onclick="doChangeLangType('{$key}');return false;" title="{$val}">{strtoupper($key)}</a>
						<!--@end-->
					<!--@end-->
				<!--@endforeach-->
			</div>
		</div>
		<div class="breadcrumbs">
			<div class="title_breadcrumbs_bar">{$lang->title_breadcrumbs_bar}</div>
			<div class="breadcrumbs_bar">{$breadcrumbs}</div>
		</div>
	</div>
	<!--@end-->

		<div class="authorArea">
		    <!--@if($history)-->
			<a href="#" class="author member_{$history->member_srl}" onclick="return false;">{$history->nick_name}</a>
		    <!--@else-->
			<!--@if(!$oDocument->getMemberSrl())-->
			    <!--@if($oDocument->isExistsHomepage())-->
				<a href="{$oDocument->getHomepageUrl()}" onclick="window.open(this.href);return false;" class="author">{$oDocument->getNickName()}</a>
			    <!--@else-->
				{$oDocument->getNickName()}
			    <!--@end-->
			<!--@else-->
			    <a href="#popup_menu_area" class="member_{$oDocument->get('member_srl')} author" onclick="return false">{$oDocument->getNickName()}</a>
			<!--@end-->
		    <!--@end-->

		    <span class="ipAddress"><!--@if($grant->manager || $module_info->display_ip_address!='N')-->{$oDocument->getIpaddress()}<!--@end--></span>

		    <!--@if(!$history && ($oDocument->isExists()||$use_history != 'N'))-->
		    <div class="command">
			<!--@if($oDocument->isExists()&&$act!='dispWikiEditPage')-->
				{@
					$oDocumentModel = getModel('document');
					$entry = $oDocumentModel->getAlias($oDocument->get('document_srl'));
				}
			    <a class="bn" href="{getUrl('act','dispWikiEditPage','entry',$entry, 'document_srl', '')}"><span>{$lang->cmd_edit}</span></a>
			<!--@end-->
			<!--@if($oDocument->isExists() && $grant->delete_document)-->
			    <a class="bn" href="#" onclick="if(confirm('{$lang->confirm_delete}')) { doDeleteWiki('{$oDocument->document_srl}'); }; return false;"><span>{$lang->cmd_delete}</span></a>
			<!--@end-->
			<!--@if($use_history != 'N')-->
			    <a class="bn" href="{getUrl('act','dispWikiHistory','document_srl',$oDocument->document_srl,'history_srl','')}"><span>{$lang->histories}</span></a>
			<!--@end-->
		    </div>
		    <!--@else-->
		    <div class="command">
			<!--@if($history)-->
			    {$lang->notice_old_revision}
			<!--@end-->
			<a class="bn" href="{getUrl('act','','history_srl','')}">{$lang->cmd_back}</a>
		    </div>
		    <!--@end-->
		</div>
	    </div>
	</div>
	<!--@elseif($oDocument)-->
	<div class="wikiRead">
	    <div class="wikiReadHeader">
		<div class="titleArea">
			<!-- Needs to acces title with get('title') instead of getTitle() because oDocument is seen as invalid when doc_srl is 0 -->
		    <h3 class="title">{$oDocument->get('title')}</h3>
		</div>
	    </div>
	</div>
	<!--@if($visit_log)-->
	<div class="visitLog">
	    {@ $bFirst = true; }
	    <!--@foreach($visit_log as $_entry)-->
		<!--@if(!$bFirst)--> > <!--@else-->{@ $bFirst = false; }<!--@end--> <a href="{getUrl('entry',$_entry, 'document_srl', '')}">{$_entry}</a>
	    <!--@end-->
	</div>
	<!--@end-->
	<!--@end-->
